import update from './atom/db/update';

declare const action_id: string;
declare const session_id: string;
declare const spaceid: string;

interface Message {
	rowdata: { _id: string }
}

async function atom(msg: Message) {
	const systemid = '5991';
	const { prepare, exec } = update(action_id, session_id, spaceid, systemid);
	prepare('class_room', [msg.rowdata]);
	const ret = await exec();
	if (ret.code === 1) {
		return 'success';
	} else {
		return 'fail';
	}
}
